package newcoder.lx_字符串的连接最长路径查找;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author Mr.wang
 * @Description
 * @Date 2020-04-11
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            String[] strings = new String[n];
            for (int i = 0; i < n; i++) {
                strings[i] = scanner.nextLine();
            }
            Arrays.sort(strings);
            for (int i = 0; i < n; i++) {
                System.out.println(strings[i]);
            }
        }
    }
}
